package ClientBlackBoxTesting;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import junit.framework.*;  

import org.junit.Before;
import org.junit.Test;

import serverComuncation.MultipleClientProtocolServer;

import client.TelnetClient;

public class ClientRunning extends TestCase{
	ClientBridge bride ;
	InputStream console;
	public void setUp(){
		try {
			console = System.in;
			super.setUp();
			TelnetClient.Debug = true;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	@Test
	public void clientNewInputTest(String fileName){
		try {
			System.setIn(new FileInputStream(fileName));
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			String[] g = {"localhost","61613"};
			TelnetClient.main(g);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public void tearDown(){
		System.setIn(console);
		TelnetClient.Debug = false;
	}

}
